<template>
  <div>
    <!-- 底部部分 -->
    <footer class="footer">
      <span class="todo-count"><strong>{{sum}}</strong>剩余</span>
      <ul class="filters">
        <li>
          <a 
          @click="changeType('all')"
          :class="{selected:type === 'all'}" 
          href="#/">全部</a>
        </li>
        <li>
          <a
          @click="changeType('active')"
          :class="{selected:type === 'active'}"  
          href="#/active">进行中</a>
        </li>
        <li>
          <a
          @click="changeType('completed')"
          :class="{selected:type === 'completed'}"  
          href="#/completed">已完成</a>
        </li>
      </ul>
      <button 
      class="clear-completed"
      @click="delBtn"
      v-show="showHide"
      >清除已完成</button>
    </footer>
  </div>
</template>

<script>
export default {
  name: 'FoodList',
  components: {},
  props: {
    sum:{
      type:Number,
      required:true
    },

    showHide:{
      type:Boolean,
      required:true
    },

    type:{
      type:String,
      required:true
    }
  },
  data() {
    return {}
  },

  methods: {
    delBtn(){
      this.$emit('delBtn')
    },

    changeType(type){
      this.$emit('changeType',type)
    }
  },
}
</script>

<style scoped></style>
